// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
// import router from 'router.js'
import MuseUI from 'muse-ui'
import NProgress from 'muse-ui-progress'
import Loading from 'muse-ui-loading'
import Message from 'muse-ui-message'
import Toast from 'muse-ui-toast'
import Router from 'vue-router'
import RouteGenerator from 'ea-router'
import goto from '@/assets/js/global/goto'
import gointo from '@/assets/js/global/gointo'
import goback from '@/assets/js/global/goback'
import '@/assets/css/app.css'
import '@/assets/css/custom.css'

import 'muse-ui/dist/muse-ui.css'
import 'muse-ui-message/dist/muse-ui-message.css'
Vue.use(MuseUI)

import ViewUI from 'view-design';
import 'view-design/dist/styles/iview.css';
Vue.use(ViewUI);

import api from '@/assets/js/api'
import com from '@/assets/js/com'
Vue.use(NProgress, {
  zIndex: 2000,
  top: 0,
  speed: 300,
  color: 'warning',
  size: 2,
  className: ''
})
Vue.use(Loading, {
  overlayColor: 'rgba(255, 255, 255, .6)',
  size: 48,
  color: 'primary',
  className: 'pos-a l0 r0 t0 b0 flcc'
})
Vue.use(Toast, {
  position: 'top'
})
Vue.use(Message)

// import theme from 'muse-ui/lib/theme';
// theme.add('custom', {
//   primary: '#4980b5',
//   secondary: '#ff4081',
//   success: '#4caf50',
//   warning: '#ffeb3b',
// }, 'light');
//
// theme.use('custom');

Vue.use(Router)
Vue.use(goto)
Vue.use(gointo)
Vue.use(goback)

Vue.prototype.$api = api
Vue.prototype.$com = com

let generator = new RouteGenerator(require.context('./views', true, /\.vue$/))
console.log(generator.generate())
let router = new Router({
  routes: [generator.generate()]
})


import Clipboard from 'v-clipboard'
Vue.use(Clipboard)



Vue.config.productionTip = false

/* eslint-disable no-new */
let vue = new Vue({
  el: '#app',
  router,
  components: {App},
  template: '<App/>'
})

export default vue
